<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    <div id="app">
        <my-com></my-com>
    </div>
    <template id="tmp">
        <div>
            <h4>{{name}}</h4>
        </div>
    </template>
    <script>
        Vue.component('my-com',{
            template:'#tmp',
            data:function(){
                return{
                    name:'马云'
                }
            }
        });
        var app=new Vue({
            el:'#app'
        });
    </script>
</body>
</html>